package com.chdwmp.product.system;


import com.chdwmp.product.constant.CommonConstants;
import com.chdwmp.product.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * @author WuJunyi
 * @create 2020-07-15 19:14
 **/
@Component
public class CommonContext {

    @Autowired
    RedisService redisService;
    @Autowired
    HttpServletRequest request;

    public String getUserToken() {
        return request.getHeader(CommonConstants.TOKEN);
    }
    public void removeUserLoginInfo() {
        redisService.deleteString(getUserToken());
    }

}
